<!doctype html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>有奖答题平台</title>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/>
    <link rel="stylesheet" href="/lib/mobile/css/common.css?000"/>
    <link rel="stylesheet" href="/lib/mobile/css/prize.css"/>
</head>
<body style="background-image: url('/lib/mobile/img/money_bg.png'); background-size: 100%;">
    <div class="prize_panel">
        <div class="prize_image"> <img src="/lib/mobile/img/money.png" alt="" /></div>
        <div class="prize_image_text_1">智慧币</div>
        <div class="prize_image_text_2">恭喜</div>
        <div class="prize_money"><strong id="money"></strong><span>智慧币</span></div>
        <div class="prize_money_caption">智慧币已经存入财产账户</div>
        <div class="prize_money_total" id="totalmoney"></div>
        <ul class="prize_link">
            <li id="viewprize"><a href="javaScript:void(0);">查看我的中奖记录</a></li>
            <li>|</li>
            <li id="coupon"><a href="javaScript:void(0);">马上兑换礼品</a></li>
        </ul>
    </div>
    <div class="close" id="close"><img src="/lib/mobile/img/close.png" alt="" /></div>
    <ul class="bottom_menu">
        <li  id="indexsy"><a href="javascript:void(0);">首页</a></li>
        <!--<li>|</li>-->
        <li  id="hdrule"><a href="javascript:void(0);">活动规则</a></li>
        <!--<li  id="point_rule"><a href="javascript:void(0);">积分规则</a></li>-->
        <!--<li>|</li>-->
        <!--<li id="prize_rule"><a href="javascript:void(0);">抽奖规则</a></li>-->
        <!--<li>|</li>-->
        <li id="center"><a href="javascript:void(0);">个人中心</a></li>
    </ul>
</body>
<script src="/lib/mobile/js/zepto.js"></script>
<script src="/lib/mobile/js/plugins/fastclick.js"></script>
<script src="/lib/mobile/js/bui.js"></script>
<script src="/lib/mobile/js/common.js?000    "></script>
<script>
    bui.ready(function () {
        // 这里写业务及控件初始化
        var storage = bui.storage();
        bui.btn({id: ".bui-page", handle: ".bui-btn"}).load();
        var pageview = {};
        pageview.init = function () {
            $("#close").on("click", function (argument) {
                // bui.back();
                bui.load({ url: BASE_URL+"mobile/index"});
            });
            $("#indexsy").on("click", function (argument) {
                bui.load({ url: BASE_URL+"mobile/index"});
            });
            $("#point_rule").on("click", function (argument) {
                bui.load({ url: BASE_URL+"mobile/point_rule"});
            });
            $("#prize_rule").on("click", function (argument) {
                bui.load({ url: BASE_URL+"mobile/prize_rule"});
            });
            $("#center").on("click", function (argument) {
                bui.load({ url: BASE_URL+"mobile/center"});
            });
            $("#coupon").on("click", function (argument) {
                bui.load({ url: BASE_URL+"mobile/coupon"});
            });
            $("#viewprize").on("click", function (argument) {
                bui.load({ url: BASE_URL+"mobile/viewprize"});
            });
            var dtid=storage.get("dtid");
            var uid=storage.get("uid");
            addDayAward(uid[0],dtid[0]);
        }
        pageview.init();
    });
    function addDayAward(uid,dtid) {
        //执行登录操作
        var loginAjax = bui.ajax({
            url: BASE_URL+"mobile/addDayAward",
            // 可选参数
            data: {
                uid:uid,
                dtid:dtid
            },
            method: "POST"
        });
        loginAjax.then(function(res) {
            var data = res.data;
            // console.log(data);
            if(data.money){
                $("#money").html(data.money);
            }else{
                $("#money").html("0");
            }
            if(data.totalmoney) {
                $("#totalmoney").html("我的财产总额" + data.totalmoney + "智慧币");
            }else{
                $("#totalmoney").html("我的财产总额0智慧币");
            }
        },function(res) {
            bui.alert("请求异常");
        })
    }
</script>
</html>